﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;


namespace nadModel.pad
{
    public partial class CustPartEntityProcess : AbstractEntityProcess
    {
        public string conection_addr = "http://nad.nadfinlo.com.cn/nad/";
        public CustPartEntity[] FindByParameter(CustPartParameter p)
        {
            string sql = " select * from " + CustPartEntity.DB_TABLES + " where company='" + p.Company + "' "
                           + " and (" + CustPartEntity.CUSTID + "='" + p.CustId + "'  or '" + p.CustId + "'='') "
                           + " and (" + CustPartEntity.NAME + " like N'" + p.CustName + "'  or '" + p.CustName + "'='') "
                           + " and (" + CustPartEntity.PART + "='" + p.Part + "'  or '" + p.Part + "'='') "
                           + " and (" + CustPartEntity.DESCRIPTION + " like N'" + p.PartDesc + "'  or '" + p.PartDesc + "'='') "
                           + " and (" + CustPartEntity.CUSTOMER_PART + "='" + p.CustPart + "'  or '" + p.CustPart + "'='') "
                           + " and (" + CustPartEntity.PARTDESCRIPTION + " like N'" + p.CustPartDesc + "'  or '" + p.CustPartDesc + "'='') ";

            CustPartEntity[] ents = (CustPartEntity[])FindBySql(sql, conection_addr);
            return ents;
        }


    }
}
